<?php
	$product_id = $params[1];
	list($sql,$all_page) = splitPage("`tbl_product_item` AS `i` LEFT JOIN `tbl_size` ON `i`.`size_id` = `tbl_size`.`size_id` LEFT JOIN `tbl_color` ON `i`.`color_id` = `tbl_color`.`color_id` ","`i`.`product_id` = '$product_id'  ORDER BY `i`.`item_id` ASC", 30, $_GET['p'],"`i`.*,`tbl_size`.`title` AS `size` , `tbl_color`.`title` AS `color`");
 
	$strPage = fetchPage($all_page,$_GET['p']);
	$query = mysql_query($sql);
	$tp->block('result');
	while($result = mysql_fetch_assoc($query)) {
		$item_id	= $result['item_id'];
		$item_color	= $result['color'];
		$item_size	= $result['size'];
		$item_count	= (int)$result['count'];
		$tp->apply();
	}
	mysql_free_result($query);
?>